其他
SQL语句中 left join 后用 on 还是 where,区别大了!
select * from student s left join class c on s.classId=c.id order by s.id
select * from student s left join class c on s.classId=c.id and s.name="张三" order by s.id
select * from student s left join class c on s.classId=c.id and c.name="三年级三班" order by s.id
select * form tab1 left join tab2 on (tab1.size = tab2.size) where tab2.name=’AAA’
select * form tab1 left join tab2 on (tab1.size = tab2.size and tab2.name=’AAA’)
tab1.size = tab2.size
tab2.name=’AAA’
tab1.size = tab2.size and tab2.name=’AAA’
往期推荐